import { RouteConfig } from 'vue-router'

// 在主应用的某个路由页面加载微应用
export const MICRO_APP_ROUTE_CONFIG: RouteConfig = {
  path: '/app/:appName/project/:id',
  name: 'microApp',
  component: () =>
    import(
      /* webpackChunkName: "studio-view" */ '../views/studio/StudioView.vue'
    ),
  children: [
    {
      path: '*',
      name: 'subMicro',
      component: () => import('../views/MicroApp.vue'),
      meta: {
        microApp: true,
      },
    },
  ],
}
//  for kg-publish router config
export const MICRO_APP_PUBLISH_CONFIG: RouteConfig = {
  path: '/app/:appName/publish',
  name: 'microAppPublish',
  component: () =>
    import(
      /* webpackChunkName: "micro-publish-view" */ '../views/studio/MicroPublishView.vue'
    ),
  children: [
    {
      path: '*',
      name: 'kgMicroPublish',
      component: () => import('../views/MicroApp.vue'),
      meta: {
        microApp: true,
      },
    },
  ],
}

// microApp 的左侧菜单
export const microAppSideMenus: Array<{
  name: string | undefined
  path: string
  icon: string
  isApp: boolean
}> = [
  {
    name: '图谱应用',
    path: '/app/knowledge/project/:id/home',
    icon: 'iconkeshifenxi1',
    isApp: true,
  },
  // {
  //   name: '图谱构建',
  //   path: '/app/kgconstruct/project/:id/home',
  //   icon: 'iconkeshifenxi1',
  //   isApp: true,
  // },
]

// export default MICRO_APP_ROUTE_CONFIG
